

const fs = require('node:fs');

// fs.readFile('./data/1.txt', 'utf8', (err, data) => {
//    console.log(data);
   
// });

let data = fs.readFileSync(__dirname+"/data/1.txt","utf8")
console.log(data);


// 写文件

fs.writeFile("./data/1.txt","黄鹤楼送孟浩然之广陵---",{flag:"a"},function (err) {
    console.log(err);
    
})